/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Controleur;

import java.awt.Image;
import javax.swing.ImageIcon;

/**
 *
 * @author Jo
 */
public class Util {
    
    public static final String USER_HOME = System.getProperty("user.home");
    public static final String FILE_SEPARATOR = System.getProperty("file.separator");
    public static final String path_to_dossier = USER_HOME + FILE_SEPARATOR + "adressBook_images";
    
    public static final String cheminIconeDefaut = path_to_dossier + FILE_SEPARATOR + "inconnu_m.jpg";
    
    public static int tailleIcone = 52;
    
    public static ImageIcon creerIcone(String chemin){
        
        ImageIcon icon = new ImageIcon(chemin);
        Image img = icon.getImage() ;
        Image newimg = img.getScaledInstance(tailleIcone, tailleIcone,  java.awt.Image.SCALE_SMOOTH) ;  
        return new ImageIcon( newimg );
    }
}
